'------------------------------------------------------------------------------------------------------------------------------------
    Private Sub LogWrite(ByVal Testo As String)
        Dim strdate As String
        strdate = DateTime.Now.ToString("dd-MM-yyyy")

        Try

            If Not System.IO.Directory.Exists(My.Application.Info.DirectoryPath & "\Log") Then
                System.IO.Directory.CreateDirectory(My.Application.Info.DirectoryPath & "\Log")
            End If

	    ' Crea il nuovo file ed aggiunge l'intestazione in prima riga: "Datetime; QR_Code; QR Read Result; QR Single Result"
            If Not System.IO.File.Exists(My.Application.Info.DirectoryPath & "\Log\Log_" & strdate & ".txt") Then
                My.Computer.FileSystem.WriteAllText(My.Application.Info.DirectoryPath & "\Log\Log_" & strdate & ".txt",
                "Datetime; QR_Code; QR Read Result; QR Single Result" & vbCrLf, True) 
            End If

            My.Computer.FileSystem.WriteAllText(My.Application.Info.DirectoryPath & "\Log\Log_" & strdate & ".txt",
            DateTime.Now.ToString("dd\/MM\/yyyy HH\:mm\:ss") & " " & Testo & vbCrLf, True)

        Catch ex As Exception

            MessageBox.Show("LogWrite: " & ex.Message)

        End Try

    End Sub

'------------------------------------------------------------------------------------------------------------------------------------

'Richiamo
LogWrite(Qrcode & ";" & ResQR & ";" & ResSC)

'------------------------------------------------------------------------------------------------------------------------------------
